package cn.tedu.sp06;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.web.client.RestTemplate;

import java.util.SimpleTimeZone;

@SpringBootApplication
public class Sp06RibbenApplication {

    public static void main(String[] args) {
        SpringApplication.run(Sp06RibbenApplication.class, args);
    }
    @LoadBalanced //负载均衡注解
    @Bean
    public RestTemplate restTemplate(){ //加bean放入spring容器
        SimpleClientHttpRequestFactory f=new SimpleClientHttpRequestFactory();
        f.setConnectTimeout(1000);
        f.setReadTimeout(1000);
        return  new RestTemplate(f);
    }

}
